<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SimpleWindow: List.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SimpleWindow
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_list_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">List.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="preprocessor">#include &quot;Utils.h&quot;</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="preprocessor">#include &lt;algorithm&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="keyword">namespace </span>sw</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span>{</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span>    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span>    <span class="keyword">class </span>List; <span class="comment">// 向前声明</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span>    <span class="keyword">using </span>StrList = List&lt;std::wstring&gt;;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00023" data-start="{" data-end="};">
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html">   23</a></span>    <span class="keyword">class </span><a class="code hl_class" href="classsw_1_1_list.html">List</a></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>    {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span>        std::shared_ptr&lt;std::vector&lt;T&gt;&gt; _pVec;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>    <span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00035" data-start="{" data-end="}">
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#ad84dc17e0d073e18e2f44871c27025de">   35</a></span>        <a class="code hl_function" href="classsw_1_1_list.html#ad84dc17e0d073e18e2f44871c27025de">List</a>()</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>            : _pVec(<a class="code hl_class" href="classsw_1_1_dictionary.html">new</a> std::<a class="code hl_class" href="classsw_1_1_dictionary.html">vector</a>&lt;T&gt;)</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>        {</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>        }</div>
</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span> </div>
<div class="foldopen" id="foldopen00043" data-start="{" data-end="}">
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#abfff18bc7387d154bc89481259f847a0">   43</a></span>        <a class="code hl_function" href="classsw_1_1_list.html#abfff18bc7387d154bc89481259f847a0">List</a>(std::initializer_list&lt;T&gt; <a class="code hl_class" href="classsw_1_1_dictionary.html">list</a>)</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>            : _pVec(<a class="code hl_class" href="classsw_1_1_dictionary.html">new</a> std::<a class="code hl_class" href="classsw_1_1_dictionary.html">vector</a>&lt;T&gt;(<a class="code hl_class" href="classsw_1_1_dictionary.html">list</a>))</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>        {</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>        }</div>
</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span> </div>
<div class="foldopen" id="foldopen00051" data-start="{" data-end="}">
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a4e4501c96b9e786d67b420312cafb8cc">   51</a></span>        <a class="code hl_function" href="classsw_1_1_list.html#a4e4501c96b9e786d67b420312cafb8cc">List</a>(<span class="keywordtype">int</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">capacity</a>)</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>            : <a class="code hl_class" href="classsw_1_1_list.html">List</a>()</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>        {</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span>            this-&gt;_pVec-&gt;reserve(<a class="code hl_class" href="classsw_1_1_dictionary.html">capacity</a>);</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>        }</div>
</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span> </div>
<div class="foldopen" id="foldopen00060" data-start="{" data-end="}">
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a39b94e22ea344de135667df991fbbe11">   60</a></span>        <span class="keyword">auto</span> <a class="code hl_function" href="classsw_1_1_list.html#a39b94e22ea344de135667df991fbbe11">begin</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>            <span class="keywordflow">return</span> this-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#a9e7e3d687118005beb08bbf9e3a3a2bc">begin</a>();</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>        }</div>
</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span> </div>
<div class="foldopen" id="foldopen00068" data-start="{" data-end="}">
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a9630ceee45943beca3b53931b7864095">   68</a></span>        <span class="keyword">auto</span> <a class="code hl_function" href="classsw_1_1_list.html#a9630ceee45943beca3b53931b7864095">end</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>            <span class="keywordflow">return</span> this-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#a98945b3a8a7c6b3e1110a406718a49c8">end</a>();</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>        }</div>
</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span> </div>
<div class="foldopen" id="foldopen00076" data-start="{" data-end="}">
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a5d1e8dcbb8c1b4ba128cb011ee401f3a">   76</a></span>        <span class="keyword">auto</span> <a class="code hl_function" href="classsw_1_1_list.html#a5d1e8dcbb8c1b4ba128cb011ee401f3a">rbegin</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>            <span class="keywordflow">return</span> this-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#aad835fe48c0fccba0e7e99001c7f3de6">rbegin</a>();</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>        }</div>
</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span> </div>
<div class="foldopen" id="foldopen00084" data-start="{" data-end="}">
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a926521f6a537069d6e398306b9f870fb">   84</a></span>        <span class="keyword">auto</span> <a class="code hl_function" href="classsw_1_1_list.html#a926521f6a537069d6e398306b9f870fb">rend</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>            <span class="keywordflow">return</span> this-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#ab46b8829980f88dd6fe703d4d2961773">rend</a>();</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>        }</div>
</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span> </div>
<div class="foldopen" id="foldopen00092" data-start="{" data-end="}">
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a56e16552c6690d1c808646c4232dd992">   92</a></span>        <span class="keyword">auto</span> &amp;<a class="code hl_function" href="classsw_1_1_list.html#a56e16552c6690d1c808646c4232dd992">operator[]</a>(<span class="keywordtype">int</span> index)<span class="keyword"> const</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>            <span class="keywordflow">return</span> this-&gt;_pVec-&gt;operator[](index);</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>        }</div>
</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span> </div>
<div class="foldopen" id="foldopen00100" data-start="{" data-end="};">
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a6c5f217b25ad01a2af3b311520bcfc8e">  100</a></span>        <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code hl_friend" href="classsw_1_1_list.html#a6c5f217b25ad01a2af3b311520bcfc8e">operator==</a>(<span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_list.html">List</a> &amp;left, <span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_list.html">List</a> &amp;right)</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>        {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>            <span class="keywordflow">return</span> left._pVec == right._pVec;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>        }</div>
</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span> </div>
<div class="foldopen" id="foldopen00108" data-start="{" data-end="};">
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#ab3818bbafce8936cc4a4f7a43dc163aa">  108</a></span>        <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code hl_friend" href="classsw_1_1_list.html#ab3818bbafce8936cc4a4f7a43dc163aa">operator!=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_list.html">List</a> &amp;left, <span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_list.html">List</a> &amp;right)</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>        {</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span>            <span class="keywordflow">return</span> left._pVec != right._pVec;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span>        }</div>
</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span> </div>
<div class="foldopen" id="foldopen00116" data-start="{" data-end="};">
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#ab50f6f7c37c3c4649e332d596d5bda2f">  116</a></span>        <span class="keyword">friend</span> std::wostream &amp;<a class="code hl_friend" href="classsw_1_1_list.html#ab50f6f7c37c3c4649e332d596d5bda2f">operator&lt;&lt;</a>(std::wostream &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">wos</a>, <span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_list.html">List</a> &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">list</a>)</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>        {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>            <a class="code hl_class" href="classsw_1_1_dictionary.html">wos</a> &lt;&lt; <a class="code hl_function" href="classsw_1_1_utils.html#abb9a32e7b7d1fb83832c9a39a84c3452">Utils::BuildStr</a>(*<a class="code hl_class" href="classsw_1_1_dictionary.html">list</a>._pVec);</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span>            <span class="keywordflow">return</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">wos</a>;</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span>        }</div>
</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span> </div>
<div class="foldopen" id="foldopen00125" data-start="{" data-end="}">
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a6998243269a9ad3bc5f4c9bdb6d90f99">  125</a></span>        <span class="keywordtype">int</span> <a class="code hl_function" href="classsw_1_1_list.html#a6998243269a9ad3bc5f4c9bdb6d90f99">Capacity</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span>            <span class="keywordflow">return</span> (<span class="keywordtype">int</span>)this-&gt;_pVec-&gt;capacity();</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span>        }</div>
</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span> </div>
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#ac06d9081e817d6c808453928dd33525a">  133</a></span>        <span class="keywordtype">int</span> <a class="code hl_function" href="classsw_1_1_list.html#ac06d9081e817d6c808453928dd33525a">Count</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>            <span class="keywordflow">return</span> (<span class="keywordtype">int</span>)this-&gt;_pVec-&gt;size();</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>        }</div>
</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span> </div>
<div class="foldopen" id="foldopen00141" data-start="{" data-end="}">
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#aed38231dffce414f40d272aba6e7099c">  141</a></span>        <span class="keywordtype">bool</span> <a class="code hl_function" href="classsw_1_1_list.html#aed38231dffce414f40d272aba6e7099c">IsEmpty</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>            <span class="keywordflow">return</span> this-&gt;_pVec-&gt;empty();</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>        }</div>
</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span> </div>
<div class="foldopen" id="foldopen00149" data-start="{" data-end="}">
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#aa14a40283db35522ff884cd737762720">  149</a></span>        <span class="keyword">auto</span> &amp;<a class="code hl_function" href="classsw_1_1_list.html#aa14a40283db35522ff884cd737762720">Append</a>(<span class="keyword">const</span> T &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>)<span class="keyword"> const</span></div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>            this-&gt;_pVec-&gt;push_back(<a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>        }</div>
</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span> </div>
<div class="foldopen" id="foldopen00158" data-start="{" data-end="}">
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a68c7aaae99a0e18274de59cad82c5743">  158</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classsw_1_1_list.html#a68c7aaae99a0e18274de59cad82c5743">Insert</a>(<span class="keywordtype">int</span> index, <span class="keyword">const</span> T &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>)<span class="keyword"> const</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>            this-&gt;_pVec-&gt;insert(this-&gt;_pVec-&gt;begin() + index, <a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>);</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>        }</div>
</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span> </div>
<div class="foldopen" id="foldopen00167" data-start="{" data-end="}">
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a459de7b71327cf474c1ac24909b49773">  167</a></span>        <span class="keywordtype">bool</span> <a class="code hl_function" href="classsw_1_1_list.html#a459de7b71327cf474c1ac24909b49773">Contains</a>(<span class="keyword">const</span> T &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>)<span class="keyword"> const</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span>            <span class="keywordflow">return</span> std::find(this-&gt;_pVec-&gt;begin(), <a class="code hl_class" href="classsw_1_1_dictionary.html">this</a>-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#a98945b3a8a7c6b3e1110a406718a49c8">end</a>(), <a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>) != this-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#a98945b3a8a7c6b3e1110a406718a49c8">end</a>();</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>        }</div>
</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span> </div>
<div class="foldopen" id="foldopen00177" data-start="{" data-end="}">
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a53adb5e4e7172f03bf87113443e9d2b5">  177</a></span>        <span class="keywordtype">int</span> <a class="code hl_function" href="classsw_1_1_list.html#a53adb5e4e7172f03bf87113443e9d2b5">IndexOf</a>(<span class="keyword">const</span> T &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>)<span class="keyword"> const</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span>            <span class="keyword">auto</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">it</a> = std::find(this-&gt;_pVec-&gt;begin(), <a class="code hl_class" href="classsw_1_1_dictionary.html">this</a>-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#a98945b3a8a7c6b3e1110a406718a49c8">end</a>(), <a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>);</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span>            <span class="keywordflow">return</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">it</a> == this-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#a98945b3a8a7c6b3e1110a406718a49c8">end</a>() ? -1 : <a class="code hl_class" href="classsw_1_1_dictionary.html">int</a>(<a class="code hl_class" href="classsw_1_1_dictionary.html">it</a> - this-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#a9e7e3d687118005beb08bbf9e3a3a2bc">begin</a>());</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>        }</div>
</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span> </div>
<div class="foldopen" id="foldopen00188" data-start="{" data-end="}">
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#ae0f77fc0d146ee739725da4cc337bbe4">  188</a></span>        <span class="keywordtype">bool</span> <a class="code hl_function" href="classsw_1_1_list.html#ae0f77fc0d146ee739725da4cc337bbe4">Remove</a>(<span class="keyword">const</span> T &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>)<span class="keyword"> const</span></div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span>            <span class="keyword">auto</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">it</a> = std::find(this-&gt;_pVec-&gt;begin(), <a class="code hl_class" href="classsw_1_1_dictionary.html">this</a>-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#a98945b3a8a7c6b3e1110a406718a49c8">end</a>(), <a class="code hl_class" href="classsw_1_1_dictionary.html">value</a>);</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span>            <span class="keywordflow">if</span> (<a class="code hl_class" href="classsw_1_1_dictionary.html">it</a> == this-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#a98945b3a8a7c6b3e1110a406718a49c8">end</a>())</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>                <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>            this-&gt;_pVec-&gt;erase(<a class="code hl_class" href="classsw_1_1_dictionary.html">it</a>);</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span>            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>        }</div>
</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span> </div>
<div class="foldopen" id="foldopen00201" data-start="{" data-end="}">
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a61b8b974966080702d94323ef0e46f85">  201</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classsw_1_1_list.html#a61b8b974966080702d94323ef0e46f85">RemoveAt</a>(<span class="keywordtype">int</span> index)<span class="keyword"> const</span></div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno">  202</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span>            this-&gt;_pVec-&gt;erase(this-&gt;_pVec-&gt;begin() + index);</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span>        }</div>
</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span> </div>
<div class="foldopen" id="foldopen00209" data-start="{" data-end="}">
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a9a9a3e947b9591f2a0e7fde6fb2ac9a8">  209</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classsw_1_1_list.html#a9a9a3e947b9591f2a0e7fde6fb2ac9a8">Clear</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span>            this-&gt;_pVec-&gt;clear();</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span>        }</div>
</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span> </div>
<div class="foldopen" id="foldopen00217" data-start="{" data-end="}">
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"><a class="line" href="classsw_1_1_list.html#a765086d760ea625121500730a2579d28">  217</a></span>        <a class="code hl_class" href="classsw_1_1_list.html">List</a> <a class="code hl_function" href="classsw_1_1_list.html#a765086d760ea625121500730a2579d28">Copy</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span><span class="keyword">        </span>{</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span>            <a class="code hl_class" href="classsw_1_1_list.html">List</a> <a class="code hl_class" href="classsw_1_1_dictionary.html">list</a>((<span class="keywordtype">int</span>)this-&gt;_pVec-&gt;capacity());</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>            <a class="code hl_class" href="classsw_1_1_dictionary.html">list</a>._pVec-&gt;assign(this-&gt;_pVec-&gt;begin(), <a class="code hl_class" href="classsw_1_1_dictionary.html">this</a>-&gt;_pVec-&gt;<a class="code hl_function" href="classsw_1_1_dictionary.html#a98945b3a8a7c6b3e1110a406718a49c8">end</a>());</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span>            <span class="keywordflow">return</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">list</a>;</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span>        }</div>
</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span>    };</div>
</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span>}</div>
<div class="ttc" id="aclasssw_1_1_dictionary_html"><div class="ttname"><a href="classsw_1_1_dictionary.html">sw::Dictionary</a></div><div class="ttdoc">字典类，内部维护了一个指向std::map的智能指针</div><div class="ttdef"><b>Definition</b> Dictionary.h:24</div></div>
<div class="ttc" id="aclasssw_1_1_dictionary_html_a98945b3a8a7c6b3e1110a406718a49c8"><div class="ttname"><a href="classsw_1_1_dictionary.html#a98945b3a8a7c6b3e1110a406718a49c8">sw::Dictionary::end</a></div><div class="ttdeci">auto end() const</div><div class="ttdoc">正向迭代器结束</div><div class="ttdef"><b>Definition</b> Dictionary.h:60</div></div>
<div class="ttc" id="aclasssw_1_1_dictionary_html_a9e7e3d687118005beb08bbf9e3a3a2bc"><div class="ttname"><a href="classsw_1_1_dictionary.html#a9e7e3d687118005beb08bbf9e3a3a2bc">sw::Dictionary::begin</a></div><div class="ttdeci">auto begin() const</div><div class="ttdoc">正向迭代器开始</div><div class="ttdef"><b>Definition</b> Dictionary.h:52</div></div>
<div class="ttc" id="aclasssw_1_1_dictionary_html_aad835fe48c0fccba0e7e99001c7f3de6"><div class="ttname"><a href="classsw_1_1_dictionary.html#aad835fe48c0fccba0e7e99001c7f3de6">sw::Dictionary::rbegin</a></div><div class="ttdeci">auto rbegin() const</div><div class="ttdoc">反向迭代器开始</div><div class="ttdef"><b>Definition</b> Dictionary.h:68</div></div>
<div class="ttc" id="aclasssw_1_1_dictionary_html_ab46b8829980f88dd6fe703d4d2961773"><div class="ttname"><a href="classsw_1_1_dictionary.html#ab46b8829980f88dd6fe703d4d2961773">sw::Dictionary::rend</a></div><div class="ttdeci">auto rend() const</div><div class="ttdoc">反向迭代器结束</div><div class="ttdef"><b>Definition</b> Dictionary.h:76</div></div>
<div class="ttc" id="aclasssw_1_1_list_html"><div class="ttname"><a href="classsw_1_1_list.html">sw::List</a></div><div class="ttdoc">列表类，内部维护了一个指向std::vector的智能指针</div><div class="ttdef"><b>Definition</b> List.h:24</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a39b94e22ea344de135667df991fbbe11"><div class="ttname"><a href="classsw_1_1_list.html#a39b94e22ea344de135667df991fbbe11">sw::List::begin</a></div><div class="ttdeci">auto begin() const</div><div class="ttdoc">正向迭代器开始</div><div class="ttdef"><b>Definition</b> List.h:60</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a459de7b71327cf474c1ac24909b49773"><div class="ttname"><a href="classsw_1_1_list.html#a459de7b71327cf474c1ac24909b49773">sw::List::Contains</a></div><div class="ttdeci">bool Contains(const T &amp;value) const</div><div class="ttdoc">列表是否包含某个值</div><div class="ttdef"><b>Definition</b> List.h:167</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a4e4501c96b9e786d67b420312cafb8cc"><div class="ttname"><a href="classsw_1_1_list.html#a4e4501c96b9e786d67b420312cafb8cc">sw::List::List</a></div><div class="ttdeci">List(int capacity)</div><div class="ttdoc">初始化列表并指定容量</div><div class="ttdef"><b>Definition</b> List.h:51</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a53adb5e4e7172f03bf87113443e9d2b5"><div class="ttname"><a href="classsw_1_1_list.html#a53adb5e4e7172f03bf87113443e9d2b5">sw::List::IndexOf</a></div><div class="ttdeci">int IndexOf(const T &amp;value) const</div><div class="ttdoc">查找值在列表中的索引</div><div class="ttdef"><b>Definition</b> List.h:177</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a56e16552c6690d1c808646c4232dd992"><div class="ttname"><a href="classsw_1_1_list.html#a56e16552c6690d1c808646c4232dd992">sw::List::operator[]</a></div><div class="ttdeci">auto &amp; operator[](int index) const</div><div class="ttdoc">获取或设置列表中指定位置的值</div><div class="ttdef"><b>Definition</b> List.h:92</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a5d1e8dcbb8c1b4ba128cb011ee401f3a"><div class="ttname"><a href="classsw_1_1_list.html#a5d1e8dcbb8c1b4ba128cb011ee401f3a">sw::List::rbegin</a></div><div class="ttdeci">auto rbegin() const</div><div class="ttdoc">反向迭代器开始</div><div class="ttdef"><b>Definition</b> List.h:76</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a61b8b974966080702d94323ef0e46f85"><div class="ttname"><a href="classsw_1_1_list.html#a61b8b974966080702d94323ef0e46f85">sw::List::RemoveAt</a></div><div class="ttdeci">void RemoveAt(int index) const</div><div class="ttdoc">移除指定索引处的值</div><div class="ttdef"><b>Definition</b> List.h:201</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a68c7aaae99a0e18274de59cad82c5743"><div class="ttname"><a href="classsw_1_1_list.html#a68c7aaae99a0e18274de59cad82c5743">sw::List::Insert</a></div><div class="ttdeci">void Insert(int index, const T &amp;value) const</div><div class="ttdoc">在指定位置插入值</div><div class="ttdef"><b>Definition</b> List.h:158</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a6998243269a9ad3bc5f4c9bdb6d90f99"><div class="ttname"><a href="classsw_1_1_list.html#a6998243269a9ad3bc5f4c9bdb6d90f99">sw::List::Capacity</a></div><div class="ttdeci">int Capacity() const</div><div class="ttdoc">列表当前的容量</div><div class="ttdef"><b>Definition</b> List.h:125</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a6c5f217b25ad01a2af3b311520bcfc8e"><div class="ttname"><a href="classsw_1_1_list.html#a6c5f217b25ad01a2af3b311520bcfc8e">sw::List::operator==</a></div><div class="ttdeci">friend bool operator==(const List &amp;left, const List &amp;right)</div><div class="ttdoc">判断是否为同一个列表</div><div class="ttdef"><b>Definition</b> List.h:100</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a765086d760ea625121500730a2579d28"><div class="ttname"><a href="classsw_1_1_list.html#a765086d760ea625121500730a2579d28">sw::List::Copy</a></div><div class="ttdeci">List Copy() const</div><div class="ttdoc">复制当前列表</div><div class="ttdef"><b>Definition</b> List.h:217</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a926521f6a537069d6e398306b9f870fb"><div class="ttname"><a href="classsw_1_1_list.html#a926521f6a537069d6e398306b9f870fb">sw::List::rend</a></div><div class="ttdeci">auto rend() const</div><div class="ttdoc">反向迭代器结束</div><div class="ttdef"><b>Definition</b> List.h:84</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a9630ceee45943beca3b53931b7864095"><div class="ttname"><a href="classsw_1_1_list.html#a9630ceee45943beca3b53931b7864095">sw::List::end</a></div><div class="ttdeci">auto end() const</div><div class="ttdoc">正向迭代器结束</div><div class="ttdef"><b>Definition</b> List.h:68</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_a9a9a3e947b9591f2a0e7fde6fb2ac9a8"><div class="ttname"><a href="classsw_1_1_list.html#a9a9a3e947b9591f2a0e7fde6fb2ac9a8">sw::List::Clear</a></div><div class="ttdeci">void Clear() const</div><div class="ttdoc">清空列表</div><div class="ttdef"><b>Definition</b> List.h:209</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_aa14a40283db35522ff884cd737762720"><div class="ttname"><a href="classsw_1_1_list.html#aa14a40283db35522ff884cd737762720">sw::List::Append</a></div><div class="ttdeci">auto &amp; Append(const T &amp;value) const</div><div class="ttdoc">添加一个值到列表末尾</div><div class="ttdef"><b>Definition</b> List.h:149</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_ab3818bbafce8936cc4a4f7a43dc163aa"><div class="ttname"><a href="classsw_1_1_list.html#ab3818bbafce8936cc4a4f7a43dc163aa">sw::List::operator!=</a></div><div class="ttdeci">friend bool operator!=(const List &amp;left, const List &amp;right)</div><div class="ttdoc">判断是否不是同一个列表</div><div class="ttdef"><b>Definition</b> List.h:108</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_ab50f6f7c37c3c4649e332d596d5bda2f"><div class="ttname"><a href="classsw_1_1_list.html#ab50f6f7c37c3c4649e332d596d5bda2f">sw::List::operator&lt;&lt;</a></div><div class="ttdeci">friend std::wostream &amp; operator&lt;&lt;(std::wostream &amp;wos, const List &amp;list)</div><div class="ttdoc">支持Utils::BuildStr</div><div class="ttdef"><b>Definition</b> List.h:116</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_abfff18bc7387d154bc89481259f847a0"><div class="ttname"><a href="classsw_1_1_list.html#abfff18bc7387d154bc89481259f847a0">sw::List::List</a></div><div class="ttdeci">List(std::initializer_list&lt; T &gt; list)</div><div class="ttdoc">使用初始化列表</div><div class="ttdef"><b>Definition</b> List.h:43</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_ac06d9081e817d6c808453928dd33525a"><div class="ttname"><a href="classsw_1_1_list.html#ac06d9081e817d6c808453928dd33525a">sw::List::Count</a></div><div class="ttdeci">int Count() const</div><div class="ttdoc">获取元素个数</div><div class="ttdef"><b>Definition</b> List.h:133</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_ad84dc17e0d073e18e2f44871c27025de"><div class="ttname"><a href="classsw_1_1_list.html#ad84dc17e0d073e18e2f44871c27025de">sw::List::List</a></div><div class="ttdeci">List()</div><div class="ttdoc">初始化列表</div><div class="ttdef"><b>Definition</b> List.h:35</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_ae0f77fc0d146ee739725da4cc337bbe4"><div class="ttname"><a href="classsw_1_1_list.html#ae0f77fc0d146ee739725da4cc337bbe4">sw::List::Remove</a></div><div class="ttdeci">bool Remove(const T &amp;value) const</div><div class="ttdoc">移除列表中第一个指定的值</div><div class="ttdef"><b>Definition</b> List.h:188</div></div>
<div class="ttc" id="aclasssw_1_1_list_html_aed38231dffce414f40d272aba6e7099c"><div class="ttname"><a href="classsw_1_1_list.html#aed38231dffce414f40d272aba6e7099c">sw::List::IsEmpty</a></div><div class="ttdeci">bool IsEmpty() const</div><div class="ttdoc">列表是否为空</div><div class="ttdef"><b>Definition</b> List.h:141</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html_abb9a32e7b7d1fb83832c9a39a84c3452"><div class="ttname"><a href="classsw_1_1_utils.html#abb9a32e7b7d1fb83832c9a39a84c3452">sw::Utils::BuildStr</a></div><div class="ttdeci">static std::wstring BuildStr(const Args &amp;...args)</div><div class="ttdoc">拼接字符串，也可使用此函数将其他类型转为wstring</div><div class="ttdef"><b>Definition</b> Utils.h:87</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_01fcd3835fb4e7d9331b722d86291b65.html">sw</a></li><li class="navelem"><a class="el" href="dir_ed5f6ece24ffcc4307a76d27c2494db3.html">inc</a></li><li class="navelem"><b>List.h</b></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0 </li>
  </ul>
</div>
</body>
</html>
